package com.jshcbd.modules.asset.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jshcbd.modules.asset.dto.InStorageItemVo;
import com.jshcbd.modules.asset.entity.InStorageItemEntity;
import com.jshcbd.modules.asset.mapper.InStoreageItemMapper;
import com.jshcbd.modules.asset.service.IInStoreageItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author zhoucd
 * @date
 * @description
 */
@Service
public class StoreageItemServiceImpl extends ServiceImpl<InStoreageItemMapper, InStorageItemEntity> implements IInStoreageItemService {

    @Autowired
    private InStoreageItemMapper inStoreageItemMapper;

    @Override
    public void addStoreageItem(InStorageItemVo vo) {
        if(vo.getCount() !=null){
            for (int i = 0; i < vo.getCount(); i++) {
                inStoreageItemMapper.insert(new InStorageItemEntity(vo));
            }
        }else{
            inStoreageItemMapper.insert(new InStorageItemEntity(vo));
        }

    }
}
